@import "themes/var";

.el-select {
  width: 100%;

  .el-select__input {
    margin-left: 8px;
    color: $input-font-color;
    caret-color: $color-primary;

    &::placeholder {
      color: $font-color-placeholder;
    }
  }

  .el-input__inner {
    color: $font-color;
    border-radius: 0;
    padding: 0 14px;
    background-color: $input-bgcolor;
    border: $border-outline;
  }

  .el-input {
    .el-select__caret {
      color: $font-color;
      font-weight: 600;
    }

    &.is-focus {
      .el-input__inner {
        border-color: $color-primary;
      }
    }

    &.is-disabled {
      .el-input__inner {
        color: $font-color;
        border: $border-outline;
        background-color: $input-bgcolor;
        opacity: 0.5;

        &:hover {
          border: $border-outline;
        }
      }

      .el-select__caret {
        opacity: 0.5;
      }
    }
  }

  &:hover {
    .el-input__inner {
      border-color: $color-primary;
    }
  }
}

.el-select__popper {
  background: $select-option-bgcolor;
  border-color: $color-primary;
  border-radius: 0;

  &.el-popper[role="tooltip"] {
    background: $select-option-bgcolor;
    border: solid 1px $color-primary;
    box-shadow: 0 2px 12px 0 rgb(0 0 0 / 10%);

    @each $placement, $adjacency in ('top': 'left', 'bottom': 'right', 'left': 'bottom', 'right': 'top') {
      &[data-popper-placement^='#{$placement}'] {
        .el-popper__arrow::before {
          background: $select-option-bgcolor;
          border-color: $color-primary;
          border-#{$placement}-color: transparent;
          border-#{$adjacency}-color: transparent;
        }
      }
    }
  }
}

.el-select-dropdown {
  border-radius: 0;
}

.el-select-dropdown__list {
  padding: 2px 0;
}

.el-select-dropdown__item {
  padding: 0 15px;
  font-size: 12px;
  color: $select-font-color;
  height: 28px;
  line-height: 28px;
  background-color: $select-option-bgcolor;
  border-left: 2px solid transparent;

  &.hover,
  &:hover {
    background-color: $select-option-bgcolor-hover;
    border-left-color: $color-primary;
  }

  &.selected {
    color: $select-color-selected;

    &::before {
      content: " ● ";
      color: $color-primary;
      font-family: "Helvetica Neue";
      display: inline-block;
      position: absolute;
      left: 4px;
      vertical-align: middle;
    }
  }
}

.datav-new-select {
  width: 100%;
  margin: 10px 0;

  .el-input {
    .el-input__inner {
      height: 30px;
      line-height: 30px;
      padding-left: 14px;
      background: $datav-data-form-bgcolor;
      border: $config-panel-border;

      &:hover {
        border-color: $color-primary;
      }
    }
  }
}

.datav-new-select-option.el-select__popper {
  border-top: none !important;
  margin-top: -12px !important;

  > .datav-new-select-option {
    margin: 0 -1px;
    padding: 0 1px;
  }

  .el-popper__arrow {
    display: none;
  }
}

.filter-select {
  .el-input {
    .el-input__inner {
      border: $datav-data-filter-border;
    }
  }
}
